package edu.sctu.alex.June.day20150614;



import java.io.*;

/**
 * Created by alex on 2015/6/14.
 */
public class IoUtil {

    public void getFileinputStream(){


        int countbyte = 0;

        FileInputStream fileInputStream;
        FileOutputStream fileOutputStream;

        try {
            fileInputStream = new FileInputStream(new File("F:\\alex/yangxu.txt"));
            fileOutputStream = new FileOutputStream(new File("F:\\alex/yangxu1.txt"));
            byte[] buffer = new byte[1024];
            try {
                while((countbyte=fileInputStream.read(buffer))!=-1){
                   fileOutputStream.write(buffer,0,countbyte);

                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                fileOutputStream.close();
                fileInputStream.close();

            } catch (IOException e) {
                e.printStackTrace();
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }


    }


}
